package com.nhxcz.bigdataweb.mapper;

import com.nhxcz.bigdataweb.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {

    @Select("SELECT * FROM user WHERE user_name = #{userName}")
    User getUser(String userName);

    @Select("SELECT * FROM user")
    List<User> getUsers();

    @Insert("INSERT INTO user VALUE (#{userName}, #{userPassword})")
    void addUser(String userName, String userPassword);
}
